﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;

namespace Battle
{
    public class UltimateData :MonoBehaviour
    {
        public enum TimeType
        {
            Frame,       //30帧基准
            Second,      //秒
            MilliSecond, //毫秒
        }

        public enum FovType
        {
            _3DMax,
            Unity3D,
        }

        public string aniName = @"attack03";

        public TimeType timeType = TimeType.Second;
        public FovType fovType = FovType.Unity3D;

        #region common data
        public float totalFrameOrTime;//大招持续时间
        public UnityEngine.Camera cam;
        public Animation anim;
        #endregion

        #region control cam fov
        [System.Serializable]
        public class FovControllerData
        {
            public float keyframeOrTime;
            public float fov;

            [HideInInspector]
            public float keyTime;
        }
        public List<FovControllerData> fovControllers;

        #endregion

        #region hidden or show object
        [System.Serializable]
        public class ShowOrHiddenActorsData
        {
            public GameObject authors;
            public bool show;
            public float keyframeOrTime;
            [HideInInspector]
            public float keyTime;
        }

        public List<ShowOrHiddenActorsData> showOrHiddenControllers;
        #endregion

        #region 站位
        public List<Transform> sourcePoints;
        public List<Transform> enemyOptionPoints;
        public List<Transform> friendOptionPoints;
        public List<Transform> neutralOptionPoints; //中立生物占位
        #endregion

        void Awake()
        {
            if (cam == null)
            {
                var cams = gameObject.transform.GetComponentsInChildren<Camera>();
                foreach(var _cam in cams)
                {
                    cam = _cam;
                }
            }

            if(anim==null)
            {
                var anims = gameObject.transform.GetComponentsInChildren<Animation>();
                foreach (var _anim in anims)
                {
                    anim = _anim;
                }
            }
        }

        /*
        #region 立绘
        public GameObject UIobj;
        public Animator UIAni;
        public float effectShowTime=1f;
        #endregion
         * */
    }
}
